<template>
  <div ref="oLazyImage" class="lazy-image">
    <img class="image" alt="" />
    <div class="box loading">加载中...</div>
    <div class="box error">加载失败</div>
  </div>
</template>

<script>
export default {
  name: 'LazyImage',
  props: {
    file: { type: String, default: '' }
  },
  data() {
    return {
      isLoad: true
    }
  },
  mounted() {}
}
</script>

<style lang="scss" scoped>
.lazy-image {
  .box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: #000;

    &.loading {
      display: block;
    }

    &.error {
      display: none;
    }
  }

  .image {
    display: none;
    width: 100%;
    height: 100%;
  }
}
</style>